<?php

namespace app\modules\index\controllers;

use app\common\controllers\CorsController;
use app\modules\index\services\AdvertService;
use app\modules\index\services\MerchantCategoryService;
use app\modules\index\services\SearchService;

class IndexController extends CorsController{

    //首页
    public function actionIndex(){
        $lng_lat=\Yii::$app->getRequest()->get("lng_lat");
        return [
            'categorys'=>MerchantCategoryService::getRecommendList(2,9),
            'merchants'=>SearchService::merchant(null,null,$lng_lat,$page,20),
            'adverts'=>AdvertService::search(1)
        ];
    }
}